cmake_minimum_required(VERSION 3.10)
set(PROJECT  cuda_project)
project(${PROJECT})
add_compile_options(-std=c++11)

set(CMAKE_CXX_STANDARD 14)
set(Torch_DIR  ../libtorch/share/cmake/Torch)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
set(CUDA_SOURCE_PROPERTY_FORMAT OBJ)
set(CUDA_SEPARABLE_COMPILATION ON)
set(include  ./include)



find_package(Torch REQUIRED)
find_package(CUDA QUIET REQUIRED)




include_directories( ${CUDA_INCLUDE_DIRS}  ${PCL_INCLUDE_DIRS} })
#include_directories("/usr/local/include/eigen3")

LINK_DIRECTORIES(/usr/lib
       /usr/local/lib)

# add_executable(cuda_project main.cpp)
# target_link_libraries(cuda_project  ${TORCH_LIBRARIES} )

# CUDA_ADD_EXECUTABLE(cuda_project
#         main_cuda.cu
#         main.cpp)
# TARGET_LINK_LIBRARIES(cuda_project ${TORCH_LIBRARIES}   ${PCL_LIBRARY_DIRS})

# add_executable(cuda_project  test.cpp)
# target_link_libraries(cuda_project  ${TORCH_LIBRARIES} )

CUDA_ADD_EXECUTABLE (cuda_project test.cpp main_cuda.cu)
TARGET_LINK_LIBRARIES(cuda_project ${TORCH_LIBRARIES}   ${PCL_LIBRARY_DIRS})
set_property(TARGET ${PROJECT} PROPERTY CXX_STANDARD 14)